[% setvar title Standardize input record separator (for portability) %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='TITLE'></a><h1>TITLE</h1>
<p>Standardize input record separator (for portability)</p>
<a name='VERSION'></a><h1>VERSION</h1>
<pre>  Maintainer: N. Hao Ching &lt;<a href='mailto:spiderboy@cpan.org'>spiderboy@cpan.org</a>&gt;
  Date: 10 Aug 2000
  Mailing List: <a href='mailto:perl6-language-io@perl.org'>perl6-language-io@perl.org</a>
  Number: 69
  Version: 3
  Status: Developing</pre>
<a name='ABSTRACT'></a><h1>ABSTRACT</h1>
<p>The default input record separator is not safe for all input files
on all platforms.  There should also be support for Unicode line
separator (U+2028) and paragraph separator (U+2029).</p>
<a name='DESCRIPTION'></a><h1>DESCRIPTION</h1>
<p>The input record separator should match the platform's C compiler
mappings of &quot;\r\n&quot; (CRLF), &quot;\n&quot; (LF) and &quot;\r&quot; (CR), which are often
(but not always, e.g., EBCDIC-based platforms [Peter Prymmer]):</p>
<pre>    000D 000A
    000A
    000D</pre>
<p>For Unicode-capable platforms, the input record separator should
also match:</p>
<pre>    2028
    2029</pre>
<p>Given this input file:</p>
<pre>    D O S CR LF    0044 004F 0053 000D 000A
    U n i x  LF    0055 006E 0069 0078 000A
    M a c CR       004D 0061 0063 000D
    l i n e  LS    006C 0069 006E 0065 2028
    p a r a  PS    0070 0061 0072 0061 2029
    l i n e        006C 0069 006E 0065</pre>
<p>This should work as expected on as many platforms as possible:</p>
<pre>    my @lines = &lt;FH&gt;;</pre>
<p>The @lines array should contain six elements.</p>
<p>Bart Lateur has suggested differentiating between ASCII-compatible
and UTF-16.  Perhaps a flag?</p>
<pre>    {
        local $utf16 = 1;
        my @lines = &lt;FH&gt;;
    }</pre>
<p>The binmode function should treat data as binary and not translate
line disciplines.  (No one objects to this so far?)</p>
<p>Whether $/ will remain in Perl 6 is uncertain, so this is not
necessarily about $/.</p>
<a name='IMPLEMENTATION'></a><h1>IMPLEMENTATION</h1>
<p>Bart Lateur suggested using a dedicated DFA regex engine.</p>
<a name='REFERENCES'></a><h1>REFERENCES</h1>
<pre>    perlport: <a href='http://www.pudge.net/macperl/perlport.html' target='_blank'>www.pudge.net</a>

    perlunicode
<a href='http://www.activestate.com/Products/ActivePerl/docs/lib/Pod/perlunicode.html' target='_blank'>www.activestate.com</a>

    RFC 58: <a href='http://dev.perl.org/rfc/58.pod' target='_blank'>dev.perl.org</a>

    Larry Wall's response to RFC 58 on 8 Aug 2000
    <a href='http://www.mail-archive.com/perl6-language@perl.org/msg01421.html' target='_blank'>www.mail-archive.com</a>
    <a href='http://www.mail-archive.com/perl6-language@perl.org/msg01423.html' target='_blank'>www.mail-archive.com</a>

    Simon Cozens' work on line disciplines in 5.6 binmode
<a href='http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-04/msg00807.html' target='_blank'>www.xray.mpe.mpg.de</a></pre>
</div>
